str = 'abcedfghijklmnopqrstuvwxyz'

# 1.截取2-5位
str1 = str[2:5]
print(str1)

# 2.截取从2-末尾
str2 = str[2:]
print(str2)

# 3.截取从开始-5
str3 = str[:5]
print(str3)

# 4.截取完整的字符串
str4 = str[:]
print(str4)

# 5.从索引1开始  每隔一个取一个
str5 = str[1::2]
print(str5)

# 6.从开始,每隔一个字符截取
str6 = str[::2]
print(str6)

# 7.截取从2 -末尾-1的字符串
str7 = str[2:-1]
print(str7)

# 8.截取字符串末尾两个字符
str8 = str[len(str)-2::]
str8_1 = str[-2:]
print(str8)
print(str8_1)

# 9.字符串的逆序
str9 = str[-1::-1]
str9_1 = str[::-1]
print(str9)
print(str9_1)